import java.io.*;
import java.util.*;
public class Pdb3UMY{
	public static void main(String[] args) {
		try{
		File file = new File("pdb.txt");
		File file1 = new File("xaa");
		
		Scanner in = new Scanner(file);
		Scanner read = new Scanner(file1);
		
		ArrayList<String> alp = new ArrayList<String>();
		
		String pdb = in.nextLine();
		String alpha = in.nextLine();

		System.out.print("pdb = " + pdb + "alpha = " + alpha);
		
		int count = 0;
		
		while(read.hasNext())
		{
		 	String test = read.nextLine();
		 	String[] test1 = test.split("\\s+");
		 	
		 	
		 	if(test1[0].equals("101m") && test1[1].equals("A"))
		 		{
		 			
		 			alp.add(test1[6]);
		 		}

		 	
		}

	

	

	for(String a: alp)
	{
		
		System.out.print(a+" ");
	}

		
		
	}
	catch(FileNotFoundException e)
	{
		e.printStackTrace();
	}
	
}
}